class Solution(object):
    def titleToNumber(self, s):
        sum = 0;
        n = len(s);
        # if(n == None):
        #     return sum;
        for i in range(0, n):
            a = ord(s[i]) - ord('A') + 1;
            sum = sum*26 + a;
        return sum;